﻿using System;

namespace Socium.Domain {
	public abstract class Disposable : IDisposable {
		protected abstract void Dispose(bool disposing);
		
		bool _disposed;

		public void Dispose() {
			if (_disposed) {
				return;
			}

			Dispose(true);

			_disposed = true;
			GC.SuppressFinalize(this);
		}

		~Disposable() {
			if (!_disposed) {
				Dispose(false);
			}
		}
	}
}
